package com.pojo;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;


public class MyTestBean implements InitializingBean {
    private String name;
    private String remark;

    public MyTestBean(){
        System.out.println("======================MyTestBean构造函数执行了============================");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("调用setName方法");
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        System.out.println("调用了setRemark方法");
        this.remark = remark;
    }

    @Override
    public String toString() {
        return "MyTestBean{" +
                "name='" + name + '\'' +
                ", remark='" + remark + '\'' +
                '}';
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("调用afterPropertiesSet方法");
        this.remark = "在初始化方法中修改之后的描述信息";
    }

    public void initMethod() {
        System.out.println("调用initMethod方法");
    }

}
